﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ParkingLot4
{
    public interface IPickStragtegy
    {
        ParkingLot? PickParkingLot(IEnumerable<ParkingLot> parkingLots);
    }

    public class StragtegyCapacityLessPriority : IPickStragtegy
    {
        public ParkingLot? PickParkingLot(IEnumerable<ParkingLot> parkingLots)
        {
            return parkingLots.OrderBy(p => p.Capacity).FirstOrDefault(p => p.IsAvailable);
        }
    }
}
